Hard-cooked eggs (eggs cooked in the shell in water) should never be boiled - simmer them in water. If boiled or cooked too long, the protein toughens or becomes rubbery and a greenish or purplish ring forms around the yolk.
To correctly cook the eggs, place them in a single layer in a pan with enough cold water to cover them completely. Bring the water to a boil, remove from heat, cover tightly with a lid, and allow to remain in the water approximately 15 to 20 minutes. Then place under running, cold water to cool quickly. This way of cooking is also known as "coddling." It does not toughen the whites as boiling does.
I haven't tried this as of yet but 15 to 20 minutes is a
lot of leeway.
I usually boil enough water to cover six to eight eggs. When the water starts
to boil I add the eggs and start a time at 12 minutes. When the water starts
to reboil I reduce the heat so only a slow boil occurs. When the timer goes
off, I place the eggs under cold running water until cool. This will make the
eggs slightly soft in the center.